package com.polaris.live.adapter.live

import android.widget.ImageView
import com.polaris.live.R
import com.polaris.live.resp.back_resp.BannerBean
import com.polaris.live.utils.image.ImageUtils
import com.polaris.live.utils.image.normal
import com.bumptech.glide.Glide
import com.zhpan.bannerview.BaseBannerAdapter
import com.zhpan.bannerview.BaseViewHolder

/**
 * LiveBannerAbsAdapter
 *
 * @author Created by 半仙 on 2023/11/9/009 16:40
 */
class LiveBannerAbsAdapter : BaseBannerAdapter<BannerBean>() {
    override fun bindData(
        holder: BaseViewHolder<BannerBean>,
        data: BannerBean?,
        position: Int,
        pageSize: Int,
    ) {
        val imageView = holder.findViewById<ImageView>(R.id.item_banner)
        Glide.with(imageView.context).load(ImageUtils.imgPath(data?.pic)).normal()
            .into(holder.findViewById(R.id.item_banner))
    }

    override fun getLayoutId(viewType: Int): Int {
        return R.layout.adapter_live_banner_abs
    }

}